var folder_js_loaded = true;

$.getJSON("/py/dir.py?dir="+path, function(data) {
	var files = data.files;
	for(x in files){
		var new_element = $("#row_model tr").clone(false);
		new_element.find('a.item_anchor').text(files[x].name);
		new_element.find('.type_span').text(files[x].type);
		if(files[x].type=='directory'){
			new_element.find('a.item_anchor').attr('href','/codycat/index.php/code/view/'+path+'/'+files[x].name);
		} else {
			new_element.find('.size_span').text(files[x].size);
			new_element.find('a.item_anchor').attr('href','/codycat/index.php/code/read/'+path+'/'+files[x].name);
		}
		new_element.appendTo($('table#file_explorer'));
		$('.progress').hide();
	}
});
